import PropTypes from 'prop-types'
import React, { memo } from 'react'
import { PlaceItemWrapper } from './style'

const PlaceItem = memo(({place, width}) => {
  return (
    <PlaceItemWrapper width={width}>
      <div className='inner'>
        <div className='item-info'>
          <img className='cover' src={place.picture_url} alt="" />
          <div className='bg-cover'></div>
          <div className='info'>
            <div className='city'>{place.city}</div>
            <div className='price'>均价 {place.price}</div>
          </div>
        </div>
      </div>
    </PlaceItemWrapper>
  )
})

PlaceItem.propTypes = {
    place: PropTypes.object,
    width: PropTypes.string
}

export default PlaceItem